using UnityEngine;

public class PauseUISur : MonoBehaviour
{
	private GameObject pauseobj;

	public UIEventListener continuebtn;

	public UIEventListener quitbtn;

	public UIEventListener settingbtn;

	public UILabel wavelabel;

	public UILabel bestlabel;

	private void Start()
	{
		continuebtn.onClick = OnClickcontinueBtn;
		quitbtn.onClick = OnClickquitBtn;
		settingbtn.onClick = OnClicksetBtn;
	}

	public void initinfo()
	{
		wavelabel.text = string.Empty + (TasksController.instance.curwave + 1);
		bestlabel.text = string.Empty + GamePlayerprefs.instance.readsurbestwave(GlobalInf.chanllenge_mode);
	}

	public void OnClickcontinueBtn(GameObject btn)
	{
		MonoInstance<AudioController>.instance.play(AudioType.UI_BTN, 0f);
		GameUIController.instance.disable_pause_sur();
	}

	public void OnClickquitBtn(GameObject btn)
	{
		PlaneMoveController.instance.isdied = true;
		TasksController.instance.is_gameover = true;
		GlobalInf.gameover = true;
		MonoInstance<AudioController>.instance.stopgamemusic();
		Time.timeScale = 1f;
		disable();
		GameUIController.instance.enable_result_sur();
	}

	public void OnClicksetBtn(GameObject btn)
	{
		MonoInstance<AudioController>.instance.play(AudioType.UI_BTN, 0f);
		disable();
		GameUIController.instance.enable_optionui();
	}

	public void enable()
	{
		if (pauseobj == null)
		{
			pauseobj = base.gameObject;
		}
		initinfo();
		NGUITools.SetActive(pauseobj, state: true);
	}

	public void disable()
	{
		NGUITools.SetActive(pauseobj, state: false);
	}
}
